package com.tedu.api.io;

import java.io.File;
import java.io.FileFilter;
import java.io.IOException;

public class HomeWork02 {
    public static void main(String[] args) throws IOException {
        File file = new File("." + File.separator + "API");
        System.out.println(file.getCanonicalPath());
        FileFilter ff=new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                String name = pathname.getName();
                return name.startsWith("s");
              }

        };
        File[]subs=file.listFiles(ff);
        for(int i=0;i<subs.length;i++){
            System.out.println("所有的文件和文件夹的名："+subs[i].getName());}
    }
}